/************************************************************
 * Filename: MessageHandler.h
 * Purpose: Message handling system, allows inter-system
 * and object communication.
 * Author: Jeremy Kings
 * Revision: 2 (20 November 2010)
 *
 * Copyright 2010, Digipen Institute of Technology
 ************************************************************/
#pragma once

#include "System.h"
#include "ContainerIncludes.h"

namespace Engine
{
	class MessageHandler
	{
	public:
		MessageHandler(std::vector<System*>* systems);
		void ReceiveMessage(Message* msg); // receive a message from somewhere (system or object)
		~MessageHandler();
	private:
		std::vector<System*>* Systems;  // systems to distribute messages to
	};

	extern MessageHandler* gMsgHandler; // global pointer to message handler

	#define Shout(msg) gMsgHandler->ReceiveMessage(msg) // macro to make sending messages less cumbersome
}
